package com.csii.activiti.server.core.mapper;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.csii.activiti.server.core.entity.db.ActCommonDataEntity;
import com.csii.activiti.server.core.entity.ActCommonQueryDataDefinition;
import com.csii.activiti.server.core.entity.db.ActCommonUpdateDataEntity;
import com.csii.activiti.server.core.entity.db.ActModifyCommonDataEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.boot.autoconfigure.condition.ConditionalOnResource;

import java.util.List;
import java.util.Map;
import java.util.Set;
@ConditionalOnResource(resources = "/mapper/ActFlowDataManagementMapper.xml")
public interface ActFlowDataManagementMapper {

    @SqlParser(filter=true)
    int queryTableNameByCount(@Param("tableName") String tableName);
    @SqlParser(filter=true)
    void createNewTable(@Param("tableName") String tableName,@Param("tableComment") String tableComment, @Param("columnList") List<ActCommonDataEntity> columnList);
    @SqlParser(filter=true)
    void deleteColumn(@Param("tableName") String tableName , @Param("columnList") List<String> columnList);
    @SqlParser(filter=true)
    void addColumn(@Param("tableName") String tableName , @Param("columnList") List<ActCommonDataEntity> columnList);
    @SqlParser(filter=true)
    void modifyColumn(@Param("tableName") String tableName , @Param("modifyColumnList") List<ActModifyCommonDataEntity> modifyColumnList);
    @SqlParser(filter=true)
    void modifyTableComment(@Param("tableName") String tableName,@Param("tableComment") String tableComment);
    @SqlParser(filter=true)
    String queryTableComment(@Param("tableName") String tableName);
    @SqlParser(filter=true)
    Set<String> queryTables();
    @SqlParser(filter=true)
    Set<String> queryTableColumns(@Param("tableName") String tableName);
    @SqlParser(filter=true)
    void batchAddData(@Param("tableName") String tableName, @Param("columnList") List<ActCommonDataEntity> columnList, @Param("addDataList") List<List<Object>> addDataList);
    @SqlParser(filter=true)
    void batchDeleteData(@Param("tableName") String tableName, @Param("ids") List<String> ids);
    @SqlParser(filter=true)
    void commonUpdateData(@Param("tableName") String tableName,@Param("updateColumnDataList") List<ActCommonUpdateDataEntity> updateColumnDataList,@Param("id")String id);
    @SqlParser(filter=true)
    Page<Map<String, Object>> queryData(Page page, @Param("tableName") String tableName, @Param("queryParams") List<ActCommonQueryDataDefinition> queryParams);
    @SqlParser(filter=true)
    void initOracleType(@Param("typeName") String typeName);
    @SqlParser(filter=true)
    void dropOracleType(@Param("oracleUserName") String oracleUserName,@Param("typeName") String typeName);
    @SqlParser(filter=true)
    void initOracleProcedure(@Param("procedureName") String procedureName,@Param("typeName") String typeName);
    @SqlParser(filter=true)
    void dropOracleProcedure(@Param("oracleUserName") String oracleUserName,@Param("procedureName") String procedureName);
    @SqlParser(filter=true)
    Set<String> queryOracleProcedureAndType();
    @SqlParser(filter=true)
    String queryOracleCurrentUserName();
    @SqlParser(filter=true)
    void batchOracleCommandExecution(@Param("procedureName") String procedureName,@Param("sqlTextList") List<String> sqlTextList);

}
